Skip to content

feat: replace Bombers tab with radial menu control and enable auto-bombing by default#159

Closed
El-Magico777 wants to merge 16 commits intov0.2.0from
bomber-tab-removal-magic
Closed

feat: replace Bombers tab with radial menu control and enable auto-bombing by default#159
El-Magico777 wants to merge 16 commits intov0.2.0from
bomber-tab-removal-magic

Conversation

@El-Magico777
Copy link
Collaborator

Build on top of #158

Description:

BREAKING CHANGE: Auto-bombing is now enabled by default for all players

Changes:

  • PlayerImpl: Changed _autoBombingEnabled default from false to true
    • All players now have auto-bombing active by default
    • Can still be overridden via radial menu manual targeting
image
  • RadialMenu: Added bomber targeting action (Slot.Bomber)

    • Shows airfield icon when right-clicking enemy land tiles
    • Gating: requires airfield, land tile, enemy ownership, war status
    • Range validation: checks bomber level and config range from all airfields
    • Targets all structure types (City, DefensePost, SAMLauncher, etc.)
    • Uses preferClosest=true for optimal targeting priority
    • Icon: airfield icon (matches build menu consistency)
  • BomberExecution: Fixed manual to auto fallback logic

    • When manual targets exhausted, now clears bomberIntent via setBomberIntent(null)
    • Ensures seamless switch back to auto-bombing mode
    • Previously would get stuck when findTargetFromQueue returned null
  • ControlPanel2: Completely removed Bombers tab

    • Deleted tab UI rendering (button and content panel ~200 lines)
    • Removed all bomber-specific state variables
    • Removed bomber methods: _startAutoBombing, _stopAutoBombing,
      _handleBomberTargetChange, populateBomberForm, _refreshBomberPlayerLists,
      _getPlayersInAirfieldRange
    • Removed bomber-related updated() hook logic
    • Removed Bombers from activeTab type union and _changeTab signature
    • Cleaned up residual references (comments, dead code)
    • Kept sendBomberIntent() for radial integration
  • UI/UX Improvements:

    • Unified bomber control via radial menu (right-click context)
    • Removed toggle complexity from control panel
    • Airfield icon provides visual consistency with build menu
    • Auto-bombing ensures bombers always active when at war

All tests pass (46 suites, 276 tests). TypeScript and ESLint clean.

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory
  • I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced
  • I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors

Please put your Discord username so you can be contacted if a bug or regression is found:

el_magico777

- Tweaked research tree UI text and tooltip content (short vs detailed)
- Updated tech tooltips with clearer unlock summaries and numbers
- Refactored tech effects unlock logic and cleaned definitions
Adds a complete structure stacking system that allows players to build
multiple instances of structures in a single tile. Stacking provides:
- Increased HP (bonus per stacked instance)
- Multiplied functionality (e.g., ×2 city = 2× population cap)

STACKING MECHANICS:
- Stack count is user-controlled (1-99) via +/- buttons in build menu
- Each game starts fresh with stack count reset to 1
- Uses localStorage for in-game UI communication only (cleared on game start)
- Stack count shown as ×N prefix in build menu display

STACKABLE STRUCTURES (9 total):
- City: ×N population cap increase
- Port: ×N trade ship supply
- Airfield: spawns N bombers
- Hospital: ×N healing effect
- Academy: ×N combat bonus
- Research Lab: ×N research boost
- Factory: ×N gold production bonus
- Missile Silo: can launch N nukes before cooldown
- SAM Launcher: fires N missiles per interception

DEFENSE POST: Stacking intentionally disabled (single instance only)

IMPLEMENTATION DETAILS:

Core data model:
- Added _stackCount field to UnitImpl for tracking stacked instances
- Added _launchesRemaining field for missile silo multi-launch tracking
- Added stackCount() and launchesRemaining() to Unit interface
- Added fields to GameUpdates and GameView for client sync

Stackable structure definitions (Upgradeables.ts):
- Added STACKABLE_STRUCTURES set (9 structure types)
- Added TECH_UPGRADEABLE_STRUCTURES set (SAM, Airfield only)
- Added helper functions: isStackableStructure(), maxStackCount(),
  isTechUpgradeableStructure(), maxStructureTechLevel()

Construction execution:
- ConstructionExecution now separates stackCount from techLevel
- Added computeStackCount() and computeTechLevel() methods
- Added applyStackingIfNeeded() to set stack count and HP bonuses

Structure-specific execution updates:
- AirfieldExecution: spawns stackCount bombers, tracks upgrades
- SAMLauncherExecution: fires stackCount missiles per interception
- MissileSiloExecution: accepts stackCount param, allows N launches
  before cooldown via launchesRemaining tracking
- DefensePostExecution: removed stacking support

Client UI:
- BuildMenu: shows ×N prefix for stacked structures
- ControlPanel2: Stack ×N UI with +/- adjustment buttons
- Transport: reads stack count and sends with build intent
- LocalPersistantStats: clears stack count settings on game start
…ited SAM/Silo stacking

- Fix structure stacking system to properly increment stackCount via setStackCount()
- Update playerMaxStructureLevel() to return 99 for all stackable structures (SAM, Silo, Airfield)
- Remove legacy cap of 3 from maxStructureLevel() for SAM and Silo
- Implement launchesRemaining system for SAM (fire stackCount times before cooldown)
- Fix SAM/Silo cooldown calculation to use effectiveMaxHealth() instead of base health
- SAM range now uses playerMaxStructureTechLevel() (tech tier 1-3), not stack count
- Display stack count instead of level for structure badges
- Add SAM tech level as secondary indicator (similar to Airfield bomber level)
- PlayerInfoOverlay and BuildMenu now show correct counts including stacked structures
- Update unitsOwned() to use stackCount() for all stackable structures
- Rename 'Upgrade Structures' button to 'Stack Structures'
…STACK_COUNT=25 and clamp in helpers (maxStackCount, maxStructureLevel, playerMaxStructureLevel)\n- Clamp ConstructionExecution desired stack, UnitImpl.setStackCount\n- Limit client intent payload and schema to 25 (Transport, Schemas)\n- Keeps UI controls honoring cap via shared helpers
- Support multiple simultaneous research priorities (Set-based)
- Add category 'Prioritize' button to set all techs in category
- Cross-category prioritization: selecting individual tech clears same-level techs from other categories
- Category prioritization clears other categories but preserves existing priorities in selected category
- Locked prioritized techs show gold background with lock icon
- Research allocation: 60% split among available priorities, 40% to others
- Priority prerequisites get 60% when priorities locked
- Update PlayerView to expose full priorities Set
- Remove ScorchedEarth upgrade and all related code
  - Delete ScorchedEarthExecution and integration tests
  - Remove SCORCHED_EARTH from UpgradeType enum
  - Remove scorchedEarthActivationCost from Config

- Remove Insurance system
  - Remove INSURANCE_REFUND message type
  - Remove insurance refund logic from UnitImpl
  - Remove structureInsuranceRefundNum/Den from Config
  - Remove ECONOMY_INSURANCE tech ID

- Remove policy directive system (referenced non-existent Economy-3 tech)
  - Delete PolicyDirectiveSelectExecution, MarkPolicyDirectivesSeenExecution
  - Delete PolicyDirectives.ts definition file
  - Remove policy schemas, intents, handlers from Transport/ExecutionManager
  - Remove policy methods from Player interface and PlayerImpl
  - Remove policy logic from all TechEffects modifier functions
  - Remove policy notification from ResearchToggleButton

- Move InternationalTrade upgrade to Land-1 tech (Road Network)

- Remove unused tech IDs: ECONOMY_INTERNATIONAL_TRADE, ECONOMY_TBD_LEVEL4, TRADE_POLICY_FRAMEWORK

- Remove unused upgrade types: WaterUpgrade1/2/3, AirUpgrade3, EconomyUpgrade1/2/3

All tests passing (46 suites, 276 tests)
The paratrooper option was not appearing in the radial menu even when Air-1 tech was researched and airfield was in range.

Root cause: Both RadialMenu.shouldShowAirAttack() and ParatrooperAttackExecution.init() were checking for obsolete UpgradeType.AirUpgrade1 instead of UpgradeType.JetEngines.

The Air-1 Early Air Power tech grants UpgradeType.JetEngines, not AirUpgrade1, so the check was always failing.

Changed both files to check for JetEngines upgrade, which is the correct requirement for paratroopers.

All tests pass (46 suites, 276 tests).
…mbing by default

BREAKING CHANGE: Auto-bombing is now enabled by default for all players

Changes:
- PlayerImpl: Changed _autoBombingEnabled default from false to true
  * All players now have auto-bombing active by default
  * Can still be overridden via radial menu manual targeting

- RadialMenu: Added bomber targeting action (Slot.Bomber)
  * Shows airfield icon when right-clicking enemy land tiles
  * Gating: requires airfield, land tile, enemy ownership, war status
  * Range validation: checks bomber level and config range from all airfields
  * Targets all structure types (City, DefensePost, SAMLauncher, etc.)
  * Uses preferClosest=true for optimal targeting priority
  * Icon: airfield icon (matches build menu consistency)

- BomberExecution: Fixed manual to auto fallback logic
  * When manual targets exhausted, now clears bomberIntent via setBomberIntent(null)
  * Ensures seamless switch back to auto-bombing mode
  * Previously would get stuck when findTargetFromQueue returned null

- ControlPanel2: Completely removed Bombers tab
  * Deleted tab UI rendering (button and content panel ~200 lines)
  * Removed all bomber-specific state variables
  * Removed bomber methods: _startAutoBombing, _stopAutoBombing,
    _handleBomberTargetChange, populateBomberForm, _refreshBomberPlayerLists,
    _getPlayersInAirfieldRange
  * Removed bomber-related updated() hook logic
  * Removed Bombers from activeTab type union and _changeTab signature
  * Cleaned up residual references (comments, dead code)
  * Kept sendBomberIntent() for radial integration

- UI/UX Improvements:
  * Unified bomber control via radial menu (right-click context)
  * Removed toggle complexity from control panel
  * Airfield icon provides visual consistency with build menu
  * Auto-bombing ensures bombers always active when at war

All tests pass (46 suites, 276 tests). TypeScript and ESLint clean.
@El-Magico777
Copy link
Collaborator Author

merged in #169

@El-Magico777 El-Magico777 removed this from the v0.2.0 milestone Feb 22, 2026
@El-Magico777 El-Magico777 added this to the Cancelled milestone Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant